import request from '@/utils/request'

// 查询房屋管理列表
export function listHouse(query) {
  return request({
    url: '/house/house/list',
    method: 'get',
    params: query
  })
}

// 查询房屋管理详细
export function getHouse(houseId) {
  return request({
    url: '/house/house/' + houseId,
    method: 'get'
  })
}

// 新增房屋管理
export function addHouse(data) {
  return request({
    url: '/house/house',
    method: 'post',
    data: data
  })
}

// 修改房屋管理
export function updateHouse(data) {
  return request({
    url: '/house/house',
    method: 'put',
    data: data
  })
}

// 删除房屋管理
export function delHouse(houseId) {
  return request({
    url: '/house/house/' + houseId,
    method: 'delete'
  })
}

// 获取业主列表选项
export function getOwnerOptions() {
  return request({
    url: '/house/house/ownerOptions',
    method: 'get'
  })
}

// 获取业主列表
export function getOwnerList() {
  return request({
    url: '/house/house/owners',
    method: 'get'
  })
}

// 搜索业主
export function searchOwners(query) {
  return request({
    url: '/house/house/searchOwners',
    method: 'get',
    params: { query }
  })
}
